//
//  ProductDetailScrollView.m
//  AppMua5
//
//  Created by duong nguyen on 9/20/12.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#import "ProductDetailScrollView.h"

@implementation ProductDetailScrollView
@synthesize productSummary,viewGroupShop,productName;
@synthesize productImage,productPrice,btLike,btComment;

-(id) init{
    [super init];
    productSummary=[[UILabel alloc]init];
    viewGroupShop=[[UIView alloc]init];
    productName=[[UILabel alloc]init];
    productImage=[[UIImageView alloc]init];
    productPrice=[[UILabel alloc]init];
    btLike=[[UIButton alloc]init];
    btComment=[[UIButton alloc]init];
    
    [self initIphoneViews];
    [self addChildViews];
    return self;
}

-(void) initIphoneViews{
    // Init product Summary
    [productSummary setFrame:CGRectMake(10, 10, 300, 20)];
    // Init Shop view group
    [viewGroupShop setFrame:CGRectMake(5, 35, 300, 112)];
    // Init product name
    [productName setFrame:CGRectMake(10, 150, 300, 24)];
    [productName setFont:[UIFont systemFontOfSize:12]];
    // Init product image
    [productImage setFrame:CGRectMake(10, 177, 300, 400)];
    [productImage setContentMode:UIViewContentModeScaleAspectFit];
    [productImage setClipsToBounds:NO];
    [productImage setBackgroundColor:[UIColor redColor]];
    // Init price
    [productPrice setFrame:CGRectMake(10, 347, 100, 20)];
    //
    [btLike setFrame:CGRectMake(172, 345,59 , 25)];
    [btComment setFrame:CGRectMake(234, 345, 73, 25)];
    
    
//    [productSummary setBackgroundColor:[UIColor blackColor]];
//    [viewGroupShop setBackgroundColor:[UIColor blackColor]];
//    [productName setBackgroundColor:[UIColor blackColor]];
//    [productImage setBackgroundColor:[UIColor blackColor]];
//    [productPrice setBackgroundColor:[UIColor blackColor]];
//    [btLike setBackgroundColor:[UIColor blackColor]];
//    [btComment setBackgroundColor:[UIColor blackColor]];
}

-(void) addChildViews{
    [self addSubview:btComment];
    [self addSubview:btLike];
    [self addSubview:productPrice];
    [self addSubview:productSummary];
    [self addSubview:viewGroupShop];
    [self addSubview:productName];
    [self addSubview:productImage];
}

-(void) dealloc{
    [productImage release];
    [viewGroupShop release];
    [productName release];
    [productSummary release];
    [super dealloc];
}
@end
